import { getChannelListApi , ChannelItem } from "@/apis"
import { useEffect, useState } from "react"

const useTabs = () => {
    const [channelList , setChannelList] = useState<ChannelItem[]>([])

    // 封装请求tabs的方法
    const getChannelList = async () => {
        const res = await getChannelListApi()
        setChannelList(res.data.data.channels)
    }
    useEffect(()=>{
        getChannelList()
    },[])
    return {
        channelList
    }
}
export {useTabs}
